var e = require("../../@babel/runtime/helpers/interopRequireDefault").default, n = e(require("../../kta/index")), a = e(require("../../api/api_YQYL.js")), t = require("../../config/Links"), i = require("../../utils/YQYL"), o = getApp();

n.default.Page({
    data: {
        id_card_name: "",
        id_card_number: "",
        phone: "",
        check_token: "",
        confirm: !1,
        imgBaseUrl: t.imageBaseUrl.YQYL
    },
    onLoad: function(e) {
        (0, i.initChannel)(e), this.setData({
            phone: o.globalData.phone
        });
    },
    onShow: function() {
        var e = this;
        a.default.getRealInfo().then(function(n) {
            var a = n.real_name_info, t = a.id_card_name, i = a.id_card_number, o = a.check_token;
            e.setData({
                id_card_name: t,
                id_card_number: i,
                check_token: o
            });
        });
    },
    toProtocolPage: function() {
        wx.navigateTo({
            url: "/pages/webview/index?url=".concat(encodeURIComponent("https://txwk.10010.com/wkpen/view/96CCeC46a9.html"))
        });
    },
    toggleProtocol: function() {
        this.setData({
            confirm: !this.data.confirm
        });
    },
    noop: function() {},
    handleSubmit: function() {
        if (this.data.confirm) {
            var e = this.data, n = {
                id_card_name: e.id_card_name,
                id_card_number: e.id_card_number,
                check_token: e.check_token
            };
            a.default.identify(n).then(function() {
                wx.navigateBack();
            }).catch(function() {});
        } else wx.showModal({
            showCancel: !1,
            confirmText: "确定",
            content: "请阅读并同意相关协议"
        });
    }
});